template <class T>
class SortingStrategy
{
public:
	SortingStrategy() {

	}
	virtual void sort(T* myArray, int size) = 0;
};

template <class T>
class InterchangeSort : public SortingStrategy<T>
{
	virtual void sort(T* myArray, int size) {
		//InterchangeSort implementation
		cout << endl << "---- InterchangeSort ----" << endl;
		for(int i = 0; i < size - 1; i++) {
			for(int j = i+1; j < size; ++j) {
				if(myArray[i] > myArray[j]) {
					T tmp = myArray[i];
					myArray[i] = myArray[j];
					myArray[j] = tmp;
				}
			}
		}
	}
};

template <class T>
class BubbleSort : public SortingStrategy<T>
{
	virtual void sort(T* myArray, int size) {
		//BubbleSort implementation
		cout << endl << "---- BubbleSort ----" << endl;
		for(int i = 0; i < size-1 ; i++) {
			for(int j = size-1; j > i; j--) {
				if(myArray[j] < myArray[j-1]) {
					T tmp = myArray[j];
					myArray[j] = myArray[j-1];
					myArray[j-1] = tmp;
				}
			}
		}
	}
};